<?php
/**
 * class App_Model_City
 *
 * @author kim
 */
class App_Model_City extends App_Model_Abstract
{
    // table name
    protected $_name = 'dine2_city';

    /**
     * list cities as "id => name" by state id
     *
     * @return array
     */
    public function getCitiesByStateId($id)
    {
        $db = $this->getTable()->getAdapter();
        $query = "SELECT `id`, `name` FROM `dine2_city` WHERE `state_id` = '$id'";
        $cities = $db->fetchPairs($query);
        return $cities;
    }
}